using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Runtime.Serialization;
using System.Collections;
using System.Data;
using System.ComponentModel;
using System.Data.OracleClient;
using WPFExcelReport.Helpers;
using WPFExcelReport.Controls;
namespace WPFExcelReport
{
    public partial class VPTALT
    {
        public DataRow Convert2PTALT(DataRow dwInput, string ITXDBVERSION, bool IsConvert = false)
        {
            DataSet SResult = new DataSet();
            SResult = QueryPTALT(dwInput, 0);
            DataRow dwReturn = null;
            if (SResult.Tables[0].Rows.Count > 0)
            {
                dwReturn = SResult.Tables[0].Rows[0];
            }
            else
            {
                dwReturn = SResult.Tables[0].NewRow();
            }
            switch (ITXDBVERSION)
            {
                case "YGR":
                    #region=========
         dwReturn["PTAMANDANT"] = " ".PadRight(2 ); 
         dwReturn["PTAPKSTKRS"] = " ".PadRight(2 ); 
         dwReturn["PTAPKST"] = " ".PadRight(4 ); 
         dwReturn["PTAMTYP"] = " ".PadRight(8 ); 
         dwReturn["PTAAGANG"] = " ".PadRight(15 ); 
         dwReturn["PTANEUB"] = " ".PadRight(8 ); 
         dwReturn["PTANEUD"] = " ".PadRight(0 ); 
         dwReturn["PTAAENB"] = " ".PadRight(8 ); 
         dwReturn["PTAAEND"] = " ".PadRight(0 ); 
         dwReturn["PTAAENZL"] = " ".PadRight(0 ); 
         dwReturn["PTATPKSTKRS1"] = " ".PadRight(2 ); 
         dwReturn["PTATPKST1"] = " ".PadRight(4 ); 
         dwReturn["PTATMTYP1"] = " ".PadRight(8 ); 
         dwReturn["PTATAGANG1"] = " ".PadRight(15 ); 
         dwReturn["PTATPOSTYP11"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP21"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP31"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP41"] = " ".PadRight(3 ); 
         dwReturn["PTATPLAN1"] = " ".PadRight(1 ); 
         dwReturn["PTATPKSTKRS2"] = " ".PadRight(2 ); 
         dwReturn["PTATPKST2"] = " ".PadRight(4 ); 
         dwReturn["PTATMTYP2"] = " ".PadRight(8 ); 
         dwReturn["PTATAGANG2"] = " ".PadRight(15 ); 
         dwReturn["PTATPOSTYP12"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP22"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP32"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP42"] = " ".PadRight(3 ); 
         dwReturn["PTATPLAN2"] = " ".PadRight(1 ); 
         dwReturn["PTATPKSTKRS3"] = " ".PadRight(2 ); 
         dwReturn["PTATPKST3"] = " ".PadRight(4 ); 
         dwReturn["PTATMTYP3"] = " ".PadRight(8 ); 
         dwReturn["PTATAGANG3"] = " ".PadRight(15 ); 
         dwReturn["PTATPOSTYP13"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP23"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP33"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP43"] = " ".PadRight(3 ); 
         dwReturn["PTATPLAN3"] = " ".PadRight(1 ); 
         dwReturn["PTATPKSTKRS4"] = " ".PadRight(2 ); 
         dwReturn["PTATPKST4"] = " ".PadRight(4 ); 
         dwReturn["PTATMTYP4"] = " ".PadRight(8 ); 
         dwReturn["PTATAGANG4"] = " ".PadRight(15 ); 
         dwReturn["PTATPOSTYP14"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP24"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP34"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP44"] = " ".PadRight(3 ); 
         dwReturn["PTATPLAN4"] = " ".PadRight(1 ); 
         dwReturn["PTATPKSTKRS5"] = " ".PadRight(2 ); 
         dwReturn["PTATPKST5"] = " ".PadRight(4 ); 
         dwReturn["PTATMTYP5"] = " ".PadRight(8 ); 
         dwReturn["PTATAGANG5"] = " ".PadRight(15 ); 
         dwReturn["PTATPOSTYP15"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP25"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP35"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP45"] = " ".PadRight(3 ); 
         dwReturn["PTATPLAN5"] = " ".PadRight(1 ); 
         dwReturn["PTATPKSTKRS6"] = " ".PadRight(2 ); 
         dwReturn["PTATPKST6"] = " ".PadRight(4 ); 
         dwReturn["PTATMTYP6"] = " ".PadRight(8 ); 
         dwReturn["PTATAGANG6"] = " ".PadRight(15 ); 
         dwReturn["PTATPOSTYP16"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP26"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP36"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP46"] = " ".PadRight(3 ); 
         dwReturn["PTATPLAN6"] = " ".PadRight(1 ); 
         dwReturn["PTATPKSTKRS7"] = " ".PadRight(2 ); 
         dwReturn["PTATPKST7"] = " ".PadRight(4 ); 
         dwReturn["PTATMTYP7"] = " ".PadRight(8 ); 
         dwReturn["PTATAGANG7"] = " ".PadRight(15 ); 
         dwReturn["PTATPOSTYP17"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP27"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP37"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP47"] = " ".PadRight(3 ); 
         dwReturn["PTATPLAN7"] = " ".PadRight(1 ); 
         dwReturn["PTATPKSTKRS8"] = " ".PadRight(2 ); 
         dwReturn["PTATPKST8"] = " ".PadRight(4 ); 
         dwReturn["PTATMTYP8"] = " ".PadRight(8 ); 
         dwReturn["PTATAGANG8"] = " ".PadRight(15 ); 
         dwReturn["PTATPOSTYP18"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP28"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP38"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP48"] = " ".PadRight(3 ); 
         dwReturn["PTATPLAN8"] = " ".PadRight(1 ); 
         dwReturn["PTATPKSTKRS9"] = " ".PadRight(2 ); 
         dwReturn["PTATPKST9"] = " ".PadRight(4 ); 
         dwReturn["PTATMTYP9"] = " ".PadRight(8 ); 
         dwReturn["PTATAGANG9"] = " ".PadRight(15 ); 
         dwReturn["PTATPOSTYP19"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP29"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP39"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP49"] = " ".PadRight(3 ); 
         dwReturn["PTATPLAN9"] = " ".PadRight(1 ); 
         dwReturn["PTATPKSTKRS10"] = " ".PadRight(2 ); 
         dwReturn["PTATPKST10"] = " ".PadRight(4 ); 
         dwReturn["PTATMTYP10"] = " ".PadRight(8 ); 
         dwReturn["PTATAGANG10"] = " ".PadRight(15 ); 
         dwReturn["PTATPOSTYP110"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP210"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP310"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP410"] = " ".PadRight(3 ); 
         dwReturn["PTATPLAN10"] = " ".PadRight(1 ); 
         dwReturn["PTATPKSTKRS11"] = " ".PadRight(2 ); 
         dwReturn["PTATPKST11"] = " ".PadRight(4 ); 
         dwReturn["PTATMTYP11"] = " ".PadRight(8 ); 
         dwReturn["PTATAGANG11"] = " ".PadRight(15 ); 
         dwReturn["PTATPOSTYP111"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP211"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP311"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP411"] = " ".PadRight(3 ); 
         dwReturn["PTATPLAN11"] = " ".PadRight(1 ); 
         dwReturn["PTATPKSTKRS12"] = " ".PadRight(2 ); 
         dwReturn["PTATPKST12"] = " ".PadRight(4 ); 
         dwReturn["PTATMTYP12"] = " ".PadRight(8 ); 
         dwReturn["PTATAGANG12"] = " ".PadRight(15 ); 
         dwReturn["PTATPOSTYP112"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP212"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP312"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP412"] = " ".PadRight(3 ); 
         dwReturn["PTATPLAN12"] = " ".PadRight(1 ); 
         dwReturn["PTATPKSTKRS13"] = " ".PadRight(2 ); 
         dwReturn["PTATPKST13"] = " ".PadRight(4 ); 
         dwReturn["PTATMTYP13"] = " ".PadRight(8 ); 
         dwReturn["PTATAGANG13"] = " ".PadRight(15 ); 
         dwReturn["PTATPOSTYP113"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP213"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP313"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP413"] = " ".PadRight(3 ); 
         dwReturn["PTATPLAN13"] = " ".PadRight(1 ); 
         dwReturn["PTATPKSTKRS14"] = " ".PadRight(2 ); 
         dwReturn["PTATPKST14"] = " ".PadRight(4 ); 
         dwReturn["PTATMTYP14"] = " ".PadRight(8 ); 
         dwReturn["PTATAGANG14"] = " ".PadRight(15 ); 
         dwReturn["PTATPOSTYP114"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP214"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP314"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP414"] = " ".PadRight(3 ); 
         dwReturn["PTATPLAN14"] = " ".PadRight(1 ); 
         dwReturn["PTATPKSTKRS15"] = " ".PadRight(2 ); 
         dwReturn["PTATPKST15"] = " ".PadRight(4 ); 
         dwReturn["PTATMTYP15"] = " ".PadRight(8 ); 
         dwReturn["PTATAGANG15"] = " ".PadRight(15 ); 
         dwReturn["PTATPOSTYP115"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP215"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP315"] = " ".PadRight(3 ); 
         dwReturn["PTATPOSTYP415"] = " ".PadRight(3 ); 
         dwReturn["PTATPLAN15"] = " ".PadRight(1 ); 
         dwReturn["PTAFILLER"] = " ".PadRight(213 ); 
                    #endregion
                    break;
                case "JLT":

                    break;
                default:

                    break;
            }
            if (IsConvert)
            {
                foreach (DataColumn cm in dwInput.Table.Columns)
                {
                    if (dwInput[cm.ColumnName].ToString() == "")
                        continue;
                    if (dwReturn.Table.Columns.Contains(cm.ColumnName))
                    {
                        dwReturn[cm.ColumnName] = dwInput[cm.ColumnName];
                    }
                }
            }
            return dwReturn;
        }
        public void MapPTALT(ref DataRow dwLocal, DataRow dwData)
        {
            BlindMap(ref dwLocal, dwData);
        }
        public void SavePTALT(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            DataSet setResult = new DataSet();
            DataTable tbLocal = null;
            DataRow dwLocal = null;
            bool flgExist = false;
            setResult = QueryPTALT(dwData);
            if (setResult.Tables.Count > 0)
            {
                tbLocal = setResult.Tables[0];
                if (tbLocal.Rows.Count > 0)
                {
                    flgExist = true;
                    dwLocal = tbLocal.Rows[0];
                }
                else
                {
                    dwLocal = tbLocal.NewRow();
                }
            }
            MapPTALT(ref dwLocal, dwData);

            if (!flgExist)
            {

                InsertPTALT(dwLocal, ITXDBVERSION);
            }
            UpdatePTALT(dwLocal);
        }
        public void InsertPTALT(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            switch (ITXDBVERSION)
            {
                case "YGR":
                    or1.CommandText = "INSERT INTO PTALT(VAKBMANDANT, VAKBKOLL, VAKBART, VAKBKUNDNR, VAKBFARBE, VAKBKDARTNR, VAKBKDARTBEZ, VAKBKDFARBNR, VAKBANDRUCK, VAKBMEGEW, VAKBMENGEH, VAKBGEWVON, VAKBGEWBIS, VAKBGEWCA, VAKBGEWFKT, VAKBGEWGRP, VAKBMEGFKT, VAKBMEGGRP, VAKBAENDZL, VAKBAENDBEN, VAKBAENDDAT, VAKBNEUBEN, VAKBNEUDAT, VAKBFILLER)"
                        + " VALUES (:VAKBMANDANT, :VAKBKOLL, :VAKBART, :VAKBKUNDNR, :VAKBFARBE, '                         ', '                         ', '                             ', ' ', '   ', '   ', 0, 0, ' ', '000000000000', ' ', '000000000000', ' ', 0, '        ', '000000', '        ', '      ', '                                          ')";
                    or1.Parameters.Add("VAKBMANDANT", OracleType.NVarChar).Value = dwData["VAKBMANDANT"].ToString();
                    or1.Parameters.Add("VAKBKOLL", OracleType.NVarChar).Value = dwData["VAKBKOLL"].ToString();
                    or1.Parameters.Add("VAKBART", OracleType.NVarChar).Value = dwData["VAKBART"].ToString();
                    or1.Parameters.Add("VAKBFARBE", OracleType.NVarChar).Value = dwData["VAKBFARBE"].ToString();
                    or1.Parameters.Add("VAKBKUNDNR", OracleType.NVarChar).Value = dwData["VAKBKUNDNR"].ToString();
                    break;
                //VAFMANDANT VAFKOLL VAFART VAFFARBE VAFBEZ VAFFFARBE

            }
            
            Connect2Proxy(or1);
        }
        public DataSet QueryPTALT(DataRow dwData, int option = 1)
        {
            DataSet Return;
            DataSet Result = new DataSet();
            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 0:
                    or1.CommandText = "SELECT * FROM PTALT WHERE  ROWNUM<2 ";
                    break;
              
                case 99:
                    or1.CommandText = "SELECT * FROM PTALT  WHERE ROWNUM<50";
                    break;
                default:
                    break;
            }
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
                Result.Tables[0].TableName = "PTALT";
            Return = Result;
            return Return;
        }
        public void DeletePTALT(DataRow dwData, int option = 1)
        {

            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    or1.CommandText = "DELETE FROM PTALT   WHERE  VAKBMANDANT=:VAKBMANDANT AND VAKBKOLL=:VAKBKOLL AND VAKBART =:VAKBART AND VAKBFARBE=:VAKBFARBE AND VAKBKUNDNR=:VAKBKUNDNR";
                     or1.Parameters.Add("VAKBMANDANT", OracleType.NVarChar).Value = dwData["VAKBMANDANT"].ToString();
                    or1.Parameters.Add("VAKBKOLL", OracleType.NVarChar).Value = dwData["VAKBKOLL"].ToString();
                    or1.Parameters.Add("VAKBART", OracleType.NVarChar).Value = dwData["VAKBART"].ToString();
                    or1.Parameters.Add("VAKBFARBE", OracleType.NVarChar).Value = dwData["VAKBFARBE"].ToString();
                    or1.Parameters.Add("VAKBKUNDNR", OracleType.NVarChar).Value = dwData["VAKBKUNDNR"].ToString();
                    break;
                default:
                    break;
            }
            Connect2Proxy(or1);
        } 
      
        public void UpdatePTALT(DataRow dwData, string ITXDBVERSION = "50.24", int option = 1)
        {
            OracleCommand or1;
            DataSet Result = new DataSet();
            or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    #region====Command==== 
                    or1.CommandText = "UPDATE PTALT SET "
                    +"PTAMANDANT= :PTAMANDANT,"
                    +"PTAPKSTKRS= :PTAPKSTKRS,"
                    +"PTAPKST= :PTAPKST,"
                    +"PTAMTYP= :PTAMTYP,"
                    +"PTAAGANG= :PTAAGANG,"
                    +"PTANEUB= :PTANEUB,"
                    +"PTANEUD= :PTANEUD,"
                    +"PTAAENB= :PTAAENB,"
                    +"PTAAEND= :PTAAEND,"
                    +"PTAAENZL= :PTAAENZL,"
                    +"PTATPKSTKRS1= :PTATPKSTKRS1,"
                    +"PTATPKST1= :PTATPKST1,"
                    +"PTATMTYP1= :PTATMTYP1,"
                    +"PTATAGANG1= :PTATAGANG1,"
                    +"PTATPOSTYP11= :PTATPOSTYP11,"
                    +"PTATPOSTYP21= :PTATPOSTYP21,"
                    +"PTATPOSTYP31= :PTATPOSTYP31,"
                    +"PTATPOSTYP41= :PTATPOSTYP41,"
                    +"PTATPLAN1= :PTATPLAN1,"
                    +"PTATPKSTKRS2= :PTATPKSTKRS2,"
                    +"PTATPKST2= :PTATPKST2,"
                    +"PTATMTYP2= :PTATMTYP2,"
                    +"PTATAGANG2= :PTATAGANG2,"
                    +"PTATPOSTYP12= :PTATPOSTYP12,"
                    +"PTATPOSTYP22= :PTATPOSTYP22,"
                    +"PTATPOSTYP32= :PTATPOSTYP32,"
                    +"PTATPOSTYP42= :PTATPOSTYP42,"
                    +"PTATPLAN2= :PTATPLAN2,"
                    +"PTATPKSTKRS3= :PTATPKSTKRS3,"
                    +"PTATPKST3= :PTATPKST3,"
                    +"PTATMTYP3= :PTATMTYP3,"
                    +"PTATAGANG3= :PTATAGANG3,"
                    +"PTATPOSTYP13= :PTATPOSTYP13,"
                    +"PTATPOSTYP23= :PTATPOSTYP23,"
                    +"PTATPOSTYP33= :PTATPOSTYP33,"
                    +"PTATPOSTYP43= :PTATPOSTYP43,"
                    +"PTATPLAN3= :PTATPLAN3,"
                    +"PTATPKSTKRS4= :PTATPKSTKRS4,"
                    +"PTATPKST4= :PTATPKST4,"
                    +"PTATMTYP4= :PTATMTYP4,"
                    +"PTATAGANG4= :PTATAGANG4,"
                    +"PTATPOSTYP14= :PTATPOSTYP14,"
                    +"PTATPOSTYP24= :PTATPOSTYP24,"
                    +"PTATPOSTYP34= :PTATPOSTYP34,"
                    +"PTATPOSTYP44= :PTATPOSTYP44,"
                    +"PTATPLAN4= :PTATPLAN4,"
                    +"PTATPKSTKRS5= :PTATPKSTKRS5,"
                    +"PTATPKST5= :PTATPKST5,"
                    +"PTATMTYP5= :PTATMTYP5,"
                    +"PTATAGANG5= :PTATAGANG5,"
                    +"PTATPOSTYP15= :PTATPOSTYP15,"
                    +"PTATPOSTYP25= :PTATPOSTYP25,"
                    +"PTATPOSTYP35= :PTATPOSTYP35,"
                    +"PTATPOSTYP45= :PTATPOSTYP45,"
                    +"PTATPLAN5= :PTATPLAN5,"
                    +"PTATPKSTKRS6= :PTATPKSTKRS6,"
                    +"PTATPKST6= :PTATPKST6,"
                    +"PTATMTYP6= :PTATMTYP6,"
                    +"PTATAGANG6= :PTATAGANG6,"
                    +"PTATPOSTYP16= :PTATPOSTYP16,"
                    +"PTATPOSTYP26= :PTATPOSTYP26,"
                    +"PTATPOSTYP36= :PTATPOSTYP36,"
                    +"PTATPOSTYP46= :PTATPOSTYP46,"
                    +"PTATPLAN6= :PTATPLAN6,"
                    +"PTATPKSTKRS7= :PTATPKSTKRS7,"
                    +"PTATPKST7= :PTATPKST7,"
                    +"PTATMTYP7= :PTATMTYP7,"
                    +"PTATAGANG7= :PTATAGANG7,"
                    +"PTATPOSTYP17= :PTATPOSTYP17,"
                    +"PTATPOSTYP27= :PTATPOSTYP27,"
                    +"PTATPOSTYP37= :PTATPOSTYP37,"
                    +"PTATPOSTYP47= :PTATPOSTYP47,"
                    +"PTATPLAN7= :PTATPLAN7,"
                    +"PTATPKSTKRS8= :PTATPKSTKRS8,"
                    +"PTATPKST8= :PTATPKST8,"
                    +"PTATMTYP8= :PTATMTYP8,"
                    +"PTATAGANG8= :PTATAGANG8,"
                    +"PTATPOSTYP18= :PTATPOSTYP18,"
                    +"PTATPOSTYP28= :PTATPOSTYP28,"
                    +"PTATPOSTYP38= :PTATPOSTYP38,"
                    +"PTATPOSTYP48= :PTATPOSTYP48,"
                    +"PTATPLAN8= :PTATPLAN8,"
                    +"PTATPKSTKRS9= :PTATPKSTKRS9,"
                    +"PTATPKST9= :PTATPKST9,"
                    +"PTATMTYP9= :PTATMTYP9,"
                    +"PTATAGANG9= :PTATAGANG9,"
                    +"PTATPOSTYP19= :PTATPOSTYP19,"
                    +"PTATPOSTYP29= :PTATPOSTYP29,"
                    +"PTATPOSTYP39= :PTATPOSTYP39,"
                    +"PTATPOSTYP49= :PTATPOSTYP49,"
                    +"PTATPLAN9= :PTATPLAN9,"
                    +"PTATPKSTKRS10= :PTATPKSTKRS10,"
                    +"PTATPKST10= :PTATPKST10,"
                    +"PTATMTYP10= :PTATMTYP10,"
                    +"PTATAGANG10= :PTATAGANG10,"
                    +"PTATPOSTYP110= :PTATPOSTYP110,"
                    +"PTATPOSTYP210= :PTATPOSTYP210,"
                    +"PTATPOSTYP310= :PTATPOSTYP310,"
                    +"PTATPOSTYP410= :PTATPOSTYP410,"
                    +"PTATPLAN10= :PTATPLAN10,"
                    +"PTATPKSTKRS11= :PTATPKSTKRS11,"
                    +"PTATPKST11= :PTATPKST11,"
                    +"PTATMTYP11= :PTATMTYP11,"
                    +"PTATAGANG11= :PTATAGANG11,"
                    +"PTATPOSTYP111= :PTATPOSTYP111,"
                    +"PTATPOSTYP211= :PTATPOSTYP211,"
                    +"PTATPOSTYP311= :PTATPOSTYP311,"
                    +"PTATPOSTYP411= :PTATPOSTYP411,"
                    +"PTATPLAN11= :PTATPLAN11,"
                    +"PTATPKSTKRS12= :PTATPKSTKRS12,"
                    +"PTATPKST12= :PTATPKST12,"
                    +"PTATMTYP12= :PTATMTYP12,"
                    +"PTATAGANG12= :PTATAGANG12,"
                    +"PTATPOSTYP112= :PTATPOSTYP112,"
                    +"PTATPOSTYP212= :PTATPOSTYP212,"
                    +"PTATPOSTYP312= :PTATPOSTYP312,"
                    +"PTATPOSTYP412= :PTATPOSTYP412,"
                    +"PTATPLAN12= :PTATPLAN12,"
                    +"PTATPKSTKRS13= :PTATPKSTKRS13,"
                    +"PTATPKST13= :PTATPKST13,"
                    +"PTATMTYP13= :PTATMTYP13,"
                    +"PTATAGANG13= :PTATAGANG13,"
                    +"PTATPOSTYP113= :PTATPOSTYP113,"
                    +"PTATPOSTYP213= :PTATPOSTYP213,"
                    +"PTATPOSTYP313= :PTATPOSTYP313,"
                    +"PTATPOSTYP413= :PTATPOSTYP413,"
                    +"PTATPLAN13= :PTATPLAN13,"
                    +"PTATPKSTKRS14= :PTATPKSTKRS14,"
                    +"PTATPKST14= :PTATPKST14,"
                    +"PTATMTYP14= :PTATMTYP14,"
                    +"PTATAGANG14= :PTATAGANG14,"
                    +"PTATPOSTYP114= :PTATPOSTYP114,"
                    +"PTATPOSTYP214= :PTATPOSTYP214,"
                    +"PTATPOSTYP314= :PTATPOSTYP314,"
                    +"PTATPOSTYP414= :PTATPOSTYP414,"
                    +"PTATPLAN14= :PTATPLAN14,"
                    +"PTATPKSTKRS15= :PTATPKSTKRS15,"
                    +"PTATPKST15= :PTATPKST15,"
                    +"PTATMTYP15= :PTATMTYP15,"
                    +"PTATAGANG15= :PTATAGANG15,"
                    +"PTATPOSTYP115= :PTATPOSTYP115,"
                    +"PTATPOSTYP215= :PTATPOSTYP215,"
                    +"PTATPOSTYP315= :PTATPOSTYP315,"
                    +"PTATPOSTYP415= :PTATPOSTYP415,"
                    +"PTATPLAN15= :PTATPLAN15,"
                    +"PTAFILLER= :PTAFILLER,"
                        + " WHERE  "
                        + "  VAKBMANDANT=:VAKBMANDANT AND VAKBKOLL=:VAKBKOLL AND VAKBART =:VAKBART AND VAKBFARBE=:VAKBFARBE AND VAKBKUNDNR=:VAKBKUNDNR";
                    #endregion

                    #region====Parameters====
          or1.Parameters.Add("PTAMANDANT", OracleType.NVarChar).Value = dwData["PTAMANDANT"].ToString(); 
          or1.Parameters.Add("PTAPKSTKRS", OracleType.NVarChar).Value = dwData["PTAPKSTKRS"].ToString(); 
          or1.Parameters.Add("PTAPKST", OracleType.NVarChar).Value = dwData["PTAPKST"].ToString(); 
          or1.Parameters.Add("PTAMTYP", OracleType.NVarChar).Value = dwData["PTAMTYP"].ToString(); 
          or1.Parameters.Add("PTAAGANG", OracleType.NVarChar).Value = dwData["PTAAGANG"].ToString(); 
          or1.Parameters.Add("PTANEUB", OracleType.NVarChar).Value = dwData["PTANEUB"].ToString(); 
          or1.Parameters.Add("PTANEUD", OracleType.NVarChar).Value = dwData["PTANEUD"].ToString(); 
          or1.Parameters.Add("PTAAENB", OracleType.NVarChar).Value = dwData["PTAAENB"].ToString(); 
          or1.Parameters.Add("PTAAEND", OracleType.NVarChar).Value = dwData["PTAAEND"].ToString(); 
          or1.Parameters.Add("PTAAENZL", OracleType.NVarChar).Value = dwData["PTAAENZL"].ToString(); 
          or1.Parameters.Add("PTATPKSTKRS1", OracleType.NVarChar).Value = dwData["PTATPKSTKRS1"].ToString(); 
          or1.Parameters.Add("PTATPKST1", OracleType.NVarChar).Value = dwData["PTATPKST1"].ToString(); 
          or1.Parameters.Add("PTATMTYP1", OracleType.NVarChar).Value = dwData["PTATMTYP1"].ToString(); 
          or1.Parameters.Add("PTATAGANG1", OracleType.NVarChar).Value = dwData["PTATAGANG1"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP11", OracleType.NVarChar).Value = dwData["PTATPOSTYP11"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP21", OracleType.NVarChar).Value = dwData["PTATPOSTYP21"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP31", OracleType.NVarChar).Value = dwData["PTATPOSTYP31"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP41", OracleType.NVarChar).Value = dwData["PTATPOSTYP41"].ToString(); 
          or1.Parameters.Add("PTATPLAN1", OracleType.NVarChar).Value = dwData["PTATPLAN1"].ToString(); 
          or1.Parameters.Add("PTATPKSTKRS2", OracleType.NVarChar).Value = dwData["PTATPKSTKRS2"].ToString(); 
          or1.Parameters.Add("PTATPKST2", OracleType.NVarChar).Value = dwData["PTATPKST2"].ToString(); 
          or1.Parameters.Add("PTATMTYP2", OracleType.NVarChar).Value = dwData["PTATMTYP2"].ToString(); 
          or1.Parameters.Add("PTATAGANG2", OracleType.NVarChar).Value = dwData["PTATAGANG2"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP12", OracleType.NVarChar).Value = dwData["PTATPOSTYP12"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP22", OracleType.NVarChar).Value = dwData["PTATPOSTYP22"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP32", OracleType.NVarChar).Value = dwData["PTATPOSTYP32"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP42", OracleType.NVarChar).Value = dwData["PTATPOSTYP42"].ToString(); 
          or1.Parameters.Add("PTATPLAN2", OracleType.NVarChar).Value = dwData["PTATPLAN2"].ToString(); 
          or1.Parameters.Add("PTATPKSTKRS3", OracleType.NVarChar).Value = dwData["PTATPKSTKRS3"].ToString(); 
          or1.Parameters.Add("PTATPKST3", OracleType.NVarChar).Value = dwData["PTATPKST3"].ToString(); 
          or1.Parameters.Add("PTATMTYP3", OracleType.NVarChar).Value = dwData["PTATMTYP3"].ToString(); 
          or1.Parameters.Add("PTATAGANG3", OracleType.NVarChar).Value = dwData["PTATAGANG3"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP13", OracleType.NVarChar).Value = dwData["PTATPOSTYP13"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP23", OracleType.NVarChar).Value = dwData["PTATPOSTYP23"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP33", OracleType.NVarChar).Value = dwData["PTATPOSTYP33"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP43", OracleType.NVarChar).Value = dwData["PTATPOSTYP43"].ToString(); 
          or1.Parameters.Add("PTATPLAN3", OracleType.NVarChar).Value = dwData["PTATPLAN3"].ToString(); 
          or1.Parameters.Add("PTATPKSTKRS4", OracleType.NVarChar).Value = dwData["PTATPKSTKRS4"].ToString(); 
          or1.Parameters.Add("PTATPKST4", OracleType.NVarChar).Value = dwData["PTATPKST4"].ToString(); 
          or1.Parameters.Add("PTATMTYP4", OracleType.NVarChar).Value = dwData["PTATMTYP4"].ToString(); 
          or1.Parameters.Add("PTATAGANG4", OracleType.NVarChar).Value = dwData["PTATAGANG4"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP14", OracleType.NVarChar).Value = dwData["PTATPOSTYP14"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP24", OracleType.NVarChar).Value = dwData["PTATPOSTYP24"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP34", OracleType.NVarChar).Value = dwData["PTATPOSTYP34"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP44", OracleType.NVarChar).Value = dwData["PTATPOSTYP44"].ToString(); 
          or1.Parameters.Add("PTATPLAN4", OracleType.NVarChar).Value = dwData["PTATPLAN4"].ToString(); 
          or1.Parameters.Add("PTATPKSTKRS5", OracleType.NVarChar).Value = dwData["PTATPKSTKRS5"].ToString(); 
          or1.Parameters.Add("PTATPKST5", OracleType.NVarChar).Value = dwData["PTATPKST5"].ToString(); 
          or1.Parameters.Add("PTATMTYP5", OracleType.NVarChar).Value = dwData["PTATMTYP5"].ToString(); 
          or1.Parameters.Add("PTATAGANG5", OracleType.NVarChar).Value = dwData["PTATAGANG5"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP15", OracleType.NVarChar).Value = dwData["PTATPOSTYP15"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP25", OracleType.NVarChar).Value = dwData["PTATPOSTYP25"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP35", OracleType.NVarChar).Value = dwData["PTATPOSTYP35"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP45", OracleType.NVarChar).Value = dwData["PTATPOSTYP45"].ToString(); 
          or1.Parameters.Add("PTATPLAN5", OracleType.NVarChar).Value = dwData["PTATPLAN5"].ToString(); 
          or1.Parameters.Add("PTATPKSTKRS6", OracleType.NVarChar).Value = dwData["PTATPKSTKRS6"].ToString(); 
          or1.Parameters.Add("PTATPKST6", OracleType.NVarChar).Value = dwData["PTATPKST6"].ToString(); 
          or1.Parameters.Add("PTATMTYP6", OracleType.NVarChar).Value = dwData["PTATMTYP6"].ToString(); 
          or1.Parameters.Add("PTATAGANG6", OracleType.NVarChar).Value = dwData["PTATAGANG6"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP16", OracleType.NVarChar).Value = dwData["PTATPOSTYP16"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP26", OracleType.NVarChar).Value = dwData["PTATPOSTYP26"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP36", OracleType.NVarChar).Value = dwData["PTATPOSTYP36"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP46", OracleType.NVarChar).Value = dwData["PTATPOSTYP46"].ToString(); 
          or1.Parameters.Add("PTATPLAN6", OracleType.NVarChar).Value = dwData["PTATPLAN6"].ToString(); 
          or1.Parameters.Add("PTATPKSTKRS7", OracleType.NVarChar).Value = dwData["PTATPKSTKRS7"].ToString(); 
          or1.Parameters.Add("PTATPKST7", OracleType.NVarChar).Value = dwData["PTATPKST7"].ToString(); 
          or1.Parameters.Add("PTATMTYP7", OracleType.NVarChar).Value = dwData["PTATMTYP7"].ToString(); 
          or1.Parameters.Add("PTATAGANG7", OracleType.NVarChar).Value = dwData["PTATAGANG7"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP17", OracleType.NVarChar).Value = dwData["PTATPOSTYP17"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP27", OracleType.NVarChar).Value = dwData["PTATPOSTYP27"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP37", OracleType.NVarChar).Value = dwData["PTATPOSTYP37"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP47", OracleType.NVarChar).Value = dwData["PTATPOSTYP47"].ToString(); 
          or1.Parameters.Add("PTATPLAN7", OracleType.NVarChar).Value = dwData["PTATPLAN7"].ToString(); 
          or1.Parameters.Add("PTATPKSTKRS8", OracleType.NVarChar).Value = dwData["PTATPKSTKRS8"].ToString(); 
          or1.Parameters.Add("PTATPKST8", OracleType.NVarChar).Value = dwData["PTATPKST8"].ToString(); 
          or1.Parameters.Add("PTATMTYP8", OracleType.NVarChar).Value = dwData["PTATMTYP8"].ToString(); 
          or1.Parameters.Add("PTATAGANG8", OracleType.NVarChar).Value = dwData["PTATAGANG8"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP18", OracleType.NVarChar).Value = dwData["PTATPOSTYP18"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP28", OracleType.NVarChar).Value = dwData["PTATPOSTYP28"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP38", OracleType.NVarChar).Value = dwData["PTATPOSTYP38"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP48", OracleType.NVarChar).Value = dwData["PTATPOSTYP48"].ToString(); 
          or1.Parameters.Add("PTATPLAN8", OracleType.NVarChar).Value = dwData["PTATPLAN8"].ToString(); 
          or1.Parameters.Add("PTATPKSTKRS9", OracleType.NVarChar).Value = dwData["PTATPKSTKRS9"].ToString(); 
          or1.Parameters.Add("PTATPKST9", OracleType.NVarChar).Value = dwData["PTATPKST9"].ToString(); 
          or1.Parameters.Add("PTATMTYP9", OracleType.NVarChar).Value = dwData["PTATMTYP9"].ToString(); 
          or1.Parameters.Add("PTATAGANG9", OracleType.NVarChar).Value = dwData["PTATAGANG9"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP19", OracleType.NVarChar).Value = dwData["PTATPOSTYP19"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP29", OracleType.NVarChar).Value = dwData["PTATPOSTYP29"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP39", OracleType.NVarChar).Value = dwData["PTATPOSTYP39"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP49", OracleType.NVarChar).Value = dwData["PTATPOSTYP49"].ToString(); 
          or1.Parameters.Add("PTATPLAN9", OracleType.NVarChar).Value = dwData["PTATPLAN9"].ToString(); 
          or1.Parameters.Add("PTATPKSTKRS10", OracleType.NVarChar).Value = dwData["PTATPKSTKRS10"].ToString(); 
          or1.Parameters.Add("PTATPKST10", OracleType.NVarChar).Value = dwData["PTATPKST10"].ToString(); 
          or1.Parameters.Add("PTATMTYP10", OracleType.NVarChar).Value = dwData["PTATMTYP10"].ToString(); 
          or1.Parameters.Add("PTATAGANG10", OracleType.NVarChar).Value = dwData["PTATAGANG10"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP110", OracleType.NVarChar).Value = dwData["PTATPOSTYP110"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP210", OracleType.NVarChar).Value = dwData["PTATPOSTYP210"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP310", OracleType.NVarChar).Value = dwData["PTATPOSTYP310"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP410", OracleType.NVarChar).Value = dwData["PTATPOSTYP410"].ToString(); 
          or1.Parameters.Add("PTATPLAN10", OracleType.NVarChar).Value = dwData["PTATPLAN10"].ToString(); 
          or1.Parameters.Add("PTATPKSTKRS11", OracleType.NVarChar).Value = dwData["PTATPKSTKRS11"].ToString(); 
          or1.Parameters.Add("PTATPKST11", OracleType.NVarChar).Value = dwData["PTATPKST11"].ToString(); 
          or1.Parameters.Add("PTATMTYP11", OracleType.NVarChar).Value = dwData["PTATMTYP11"].ToString(); 
          or1.Parameters.Add("PTATAGANG11", OracleType.NVarChar).Value = dwData["PTATAGANG11"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP111", OracleType.NVarChar).Value = dwData["PTATPOSTYP111"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP211", OracleType.NVarChar).Value = dwData["PTATPOSTYP211"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP311", OracleType.NVarChar).Value = dwData["PTATPOSTYP311"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP411", OracleType.NVarChar).Value = dwData["PTATPOSTYP411"].ToString(); 
          or1.Parameters.Add("PTATPLAN11", OracleType.NVarChar).Value = dwData["PTATPLAN11"].ToString(); 
          or1.Parameters.Add("PTATPKSTKRS12", OracleType.NVarChar).Value = dwData["PTATPKSTKRS12"].ToString(); 
          or1.Parameters.Add("PTATPKST12", OracleType.NVarChar).Value = dwData["PTATPKST12"].ToString(); 
          or1.Parameters.Add("PTATMTYP12", OracleType.NVarChar).Value = dwData["PTATMTYP12"].ToString(); 
          or1.Parameters.Add("PTATAGANG12", OracleType.NVarChar).Value = dwData["PTATAGANG12"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP112", OracleType.NVarChar).Value = dwData["PTATPOSTYP112"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP212", OracleType.NVarChar).Value = dwData["PTATPOSTYP212"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP312", OracleType.NVarChar).Value = dwData["PTATPOSTYP312"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP412", OracleType.NVarChar).Value = dwData["PTATPOSTYP412"].ToString(); 
          or1.Parameters.Add("PTATPLAN12", OracleType.NVarChar).Value = dwData["PTATPLAN12"].ToString(); 
          or1.Parameters.Add("PTATPKSTKRS13", OracleType.NVarChar).Value = dwData["PTATPKSTKRS13"].ToString(); 
          or1.Parameters.Add("PTATPKST13", OracleType.NVarChar).Value = dwData["PTATPKST13"].ToString(); 
          or1.Parameters.Add("PTATMTYP13", OracleType.NVarChar).Value = dwData["PTATMTYP13"].ToString(); 
          or1.Parameters.Add("PTATAGANG13", OracleType.NVarChar).Value = dwData["PTATAGANG13"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP113", OracleType.NVarChar).Value = dwData["PTATPOSTYP113"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP213", OracleType.NVarChar).Value = dwData["PTATPOSTYP213"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP313", OracleType.NVarChar).Value = dwData["PTATPOSTYP313"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP413", OracleType.NVarChar).Value = dwData["PTATPOSTYP413"].ToString(); 
          or1.Parameters.Add("PTATPLAN13", OracleType.NVarChar).Value = dwData["PTATPLAN13"].ToString(); 
          or1.Parameters.Add("PTATPKSTKRS14", OracleType.NVarChar).Value = dwData["PTATPKSTKRS14"].ToString(); 
          or1.Parameters.Add("PTATPKST14", OracleType.NVarChar).Value = dwData["PTATPKST14"].ToString(); 
          or1.Parameters.Add("PTATMTYP14", OracleType.NVarChar).Value = dwData["PTATMTYP14"].ToString(); 
          or1.Parameters.Add("PTATAGANG14", OracleType.NVarChar).Value = dwData["PTATAGANG14"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP114", OracleType.NVarChar).Value = dwData["PTATPOSTYP114"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP214", OracleType.NVarChar).Value = dwData["PTATPOSTYP214"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP314", OracleType.NVarChar).Value = dwData["PTATPOSTYP314"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP414", OracleType.NVarChar).Value = dwData["PTATPOSTYP414"].ToString(); 
          or1.Parameters.Add("PTATPLAN14", OracleType.NVarChar).Value = dwData["PTATPLAN14"].ToString(); 
          or1.Parameters.Add("PTATPKSTKRS15", OracleType.NVarChar).Value = dwData["PTATPKSTKRS15"].ToString(); 
          or1.Parameters.Add("PTATPKST15", OracleType.NVarChar).Value = dwData["PTATPKST15"].ToString(); 
          or1.Parameters.Add("PTATMTYP15", OracleType.NVarChar).Value = dwData["PTATMTYP15"].ToString(); 
          or1.Parameters.Add("PTATAGANG15", OracleType.NVarChar).Value = dwData["PTATAGANG15"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP115", OracleType.NVarChar).Value = dwData["PTATPOSTYP115"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP215", OracleType.NVarChar).Value = dwData["PTATPOSTYP215"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP315", OracleType.NVarChar).Value = dwData["PTATPOSTYP315"].ToString(); 
          or1.Parameters.Add("PTATPOSTYP415", OracleType.NVarChar).Value = dwData["PTATPOSTYP415"].ToString(); 
          or1.Parameters.Add("PTATPLAN15", OracleType.NVarChar).Value = dwData["PTATPLAN15"].ToString(); 
          or1.Parameters.Add("PTAFILLER", OracleType.NVarChar).Value = dwData["PTAFILLER"].ToString(); 
                    #endregion
                    break; 
                default:
                    break;
            }


            Connect2Proxy(or1);
        }
    }
}
